from django.db import models

import datetime


# Create your models here.
# 用户账号信息表
class UserInfo(models.Model):
    name = models.CharField(verbose_name="用户名", max_length=32, db_index=True)  # db_index=True 创建索引
    email = models.EmailField(verbose_name="邮 箱", max_length=32)
    mobile_phone = models.CharField(verbose_name="手机号", max_length=32)
    password = models.CharField(verbose_name="密码", max_length=32)


# 交易信息表
class UransactionRecord(models.Model):
    state = models.CharField(verbose_name="状态", max_length=32, help_text="状态")
    user_id = models.CharField(verbose_name="用户ID", max_length=32, help_text="用户ID", db_index=True)
    package_id = models.CharField(verbose_name="套餐ID", max_length=32, default="1", help_text="套餐ID")
    payment_amount = models.FloatField(verbose_name="支付金额", default=0, help_text="支付金额")
    start_date = models.DateTimeField(verbose_name="开始时间", default=datetime.datetime.now().strftime('%Y-%m-%d %T'),
                                      help_text="状态")
    end_date = models.DateTimeField(verbose_name="结束时间",  help_text="结束时间", null=True)
    qty = models.IntegerField(verbose_name="数量", default=0, help_text="数量")
    order_code = models.CharField(verbose_name="订单编号", max_length=32, help_text="订单编码", null=True)


# 会员信息表
class PriceStrategy(models.Model):
    type_price = models.CharField(verbose_name="分类", max_length=32)
    title = models.CharField(verbose_name="标题", max_length=32)
    price = models.FloatField(verbose_name="价格")
    project_qty = models.IntegerField(verbose_name="创建项目数量")
    project_member_qty = models.IntegerField(verbose_name="项目成员数量")
    space = models.IntegerField(verbose_name="空间大小")
    file = models.IntegerField(verbose_name="单个文件大小")


# 项目信息
class ProjectInformation(models.Model):
    project_name = models.CharField(verbose_name="项目名称", max_length=32)
    describe = models.CharField(verbose_name="项目描述", max_length=32)
    color = models.CharField(verbose_name="颜色", max_length=32)
    star_labe = models.CharField(verbose_name="星标", max_length=32)
    project_in_member_qty = models.IntegerField(verbose_name="参与人数")
    created_by = models.CharField(verbose_name="创建人", max_length=32)
    used_space = models.IntegerField(verbose_name="已使用空间")


#  项目参与者信息
class ProjectParticipant(models.Model):
    project_id = models.CharField(verbose_name="项目编码", max_length=32)
    project_in_membe_id = models.CharField(verbose_name="参与人ID", max_length=32)
    star_labe = models.CharField(verbose_name="星标", max_length=32)